package niuke;

import java.math.BigInteger;
import java.util.Scanner;

public class 合唱团 {

    static int n ;
    static int n2;
    static int[] students;
    static int d ;
    static long max = -999999999;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        students = new int[n];
        for(int i=0;i<n;i++){
            students[i] = scanner.nextInt();
        }
        n2 = scanner.nextInt();
        d = scanner.nextInt();
        for(int i=0;i<=n-n2;i++){
            dfs(i,1,1);
        }
        System.out.println(max);
    }

    //p:当前位置  K:当前有多少元素
    public static void dfs(int p,int k,long mill){
        //判断越界
        if(p>=n || k>n){
            return;
        }
        mill = mill * students[p];
        //判断成功
        if(k == n2){
            if(mill > max){
                max = mill;
            }
            return;
        }
        //可以选择d个
        for(int i=1;i<=d;i++){
            dfs(p+i,k+1,mill);
        }
    }
}
